#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2019, Intel Corporation

#
# src/test/rpmem_obc_int/TEST0 -- integration test for rpmem_obc and
# rpmemd_obc modules
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type none
require_build_type nondebug debug

setup

require_nodes 2
require_node_log_files 0 $RPMEMD_LOG_FILE
require_node_log_files 1 $RPMEM_LOG_FILE

RPMEM_CMD="\"cd ${NODE_TEST_DIR[0]} && UNITTEST_FORCE_QUIET=1 \
	LD_LIBRARY_PATH=${NODE_LD_LIBRARY_PATH[0]}:$REMOTE_LD_LIBRARY_PATH \
	./rpmem_obc_int$EXESUFFIX server\""

export_vars_node 1 RPMEM_CMD

expect_normal_exit run_on_node 1 ./rpmem_obc_int$EXESUFFIX\
	client_create ${NODE_ADDR[0]}

expect_normal_exit run_on_node 1 ./rpmem_obc_int$EXESUFFIX\
	client_open ${NODE_ADDR[0]}

expect_normal_exit run_on_node 1 ./rpmem_obc_int$EXESUFFIX\
	client_set_attr ${NODE_ADDR[0]}

pass
